<?php
namespace app\listener;

use app\event\UserRegisteredEvent;
use think\facade\Log;

class UserRegisteredListener
{
    public function handle(UserRegisteredEvent $event)
    {
        // 处理用户注册事件
        $userId = $event->userId;

        // 例如，记录日志
        Log::info("用ok户 {$userId} 注册成功");

        // 或者发送欢迎邮件
        // Mail::to($user->email)->send(new WelcomeMail());
    }
}